package com.admin.utils.server;


import com.admin.utils.arith.Arith;

/**
 * CPU相关信息
 *
 * @author kuaiting
 */
public class Cpu
{
    /**
     * 核心数
     */
    private int cpuNum;

    /**
     * CPU总的使用率
     */
    private String total;

    /**
     * CPU系统使用率
     */
    private String sys;

    /**
     * CPU用户使用率
     */
    private String used;

    /**
     * CPU当前等待率
     */
    private String wait;

    /**
     * CPU当前空闲率
     */
    private String free;

    public int getCpuNum()
    {
        return cpuNum;
    }

    public void setCpuNum(int cpuNum)
    {
        this.cpuNum = cpuNum;
    }

    public String getTotal()
    {
        return Arith.round(Arith.mul(total, "100"), 2);
    }

    public void setTotal(String total)
    {
        this.total = total;
    }

    public String getSys()
    {
        return Arith.round(Arith.mul(Arith.div(sys,total), "100"), 2);
    }

    public void setSys(String sys)
    {
        this.sys = sys;
    }

    public String getUsed()
    {
        return Arith.round(Arith.mul(Arith.div(used,total), "100"), 2);
    }

    public void setUsed(String used)
    {
        this.used = used;
    }

    public String getWait()
    {
        return Arith.round(Arith.mul(Arith.div(wait,total), "100"), 2);
    }

    public void setWait(String wait)
    {
        this.wait = wait;
    }

    public String getFree()
    {
        return Arith.round(Arith.mul(Arith.div(free,total),"100" ), 2);
    }

    public void setFree(String free)
    {
        this.free = free;
    }
}
